package testsw.order.feign;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.github.pagehelper.PageInfo;
import com.testsw.order.pojo.Reporttable;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import testsw.order.feign.Fallback.ReporttableFallback;

import java.util.List;

/****
 * @Author: zhangsan
 * @Description:
 * @Date: 2020-03-20 09:36:48
 *****/
@FeignClient(value="service-provider2", fallback = ReporttableFallback.class)
public interface ReporttableFeign {

    /***
     * Reporttable分页条件搜索实现
     * @param reporttable
     * @param page
     * @param size
     * @return
     */
    @PostMapping(value = "/reporttable/search/{page}/{size}" )
    Result<PageInfo> findPage(@RequestBody(required = false) Reporttable reporttable, @PathVariable("page") int page, @PathVariable("size") int size);

    /***
     * Reporttable分页搜索实现
     * @param page:当前页
     * @param size:每页显示多少条
     * @return
     */
    @GetMapping(value = "/reporttable/search/{page}/{size}" )
    Result<PageInfo> findPage(@PathVariable("page") int page, @PathVariable("size") int size);

    /***
     * 多条件搜索品牌数据
     * @param reporttable
     * @return
     */
    @PostMapping(value = "/reporttable/search" )
    Result<List<Reporttable>> findList(@RequestBody(required = false) Reporttable reporttable);

    /***
     * 根据ID删除品牌数据
     * @param id
     * @return
     */
    @DeleteMapping(value = "/reporttable/{id}" )
    Result delete(@PathVariable("id") Integer id);

    /***
     * 修改Reporttable数据
     * @param reporttable
     * @param id
     * @return
     */
    @PutMapping(value="/reporttable/{id}")
    Result update(@RequestBody Reporttable reporttable, @PathVariable("id") Integer id);

    /***
     * 新增Reporttable数据
     * @param reporttable
     * @return
     */
    @PostMapping(value="/reporttable")
    Result add(@RequestBody Reporttable reporttable);

    /***
     * 根据ID查询Reporttable数据
     * @param id
     * @return
     */
    @GetMapping("/reporttable/{id}")
    Result<Reporttable> findById(@PathVariable("id") Integer id);

    /***
     * 查询Reporttable全部数据
     * @return
     */
    @GetMapping("/reporttable")
    Result<List<Reporttable>> findAll();
}